﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/TemplateAdmin.Master" AutoEventWireup="true" CodeBehind="LensList.aspx.cs" Inherits="OnlineDigitalCameraWebsite.Admin.LensList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2 class="sub-header">
        <asp:Label ID="Label1" runat="server" Text="Danh sách Lens"></asp:Label></h2>
    <p>
        <asp:Button ID="btnThem" runat="server" Text="Thêm Lens mới" CssClass="btn btn-primary" OnClick="btnThem_Click" />
        </p>
            <asp:Label ID="lbThongBao" class="label label-info" runat="server" Text=""></asp:Label>

            <br />
            <asp:GridView ID="gvDS" runat="server" AllowPaging="True" class="table" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" OnPageIndexChanging="gvDS_PageIndexChanging" OnRowCancelingEdit="gvDS_RowCancelingEdit" OnRowEditing="gvDS_RowEditing" OnSelectedIndexChanged="gvDS_SelectedIndexChanged" OnSelectedIndexChanging="gvDS_SelectedIndexChanging" OnRowDeleting="gvDS_RowDeleting">
                <AlternatingRowStyle BackColor="Gainsboro" />
                <Columns>

                    <asp:TemplateField HeaderText="Mã">
                        <EditItemTemplate>
                            <asp:Label ID="id" runat="server" Text='<%# Bind("lensId") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="id1" runat="server" Text='<%# Bind("lensId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên ống kính">
                        <EditItemTemplate>
                            <asp:Label ID="lensNames" runat="server" Text='<%# Bind("lensNames") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lensNames1" runat="server" Text='<%# Bind("lensNames") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="lensFocallensgth">
                        <EditItemTemplate>
                            <asp:Label ID="product_code" runat="server" Text='<%# Bind("lensFocallensgth") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="product_code1" runat="server" Text='<%# Bind("lensFocallensgth") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField> 
                    <asp:TemplateField HeaderText="Hình Ảnh">
                        <EditItemTemplate>
                            <asp:Image ID="image" runat="server" ImageUrl='<%# Eval("lensImages") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Image ID="image1" runat="server" Height="100px" Width="100px" ImageUrl='<%# Eval("lensImages") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Giá">
                        <EditItemTemplate>
                            <asp:Label ID="price" runat="server" Text='<%# Bind("lensPrice") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="price1" runat="server" Text='<%# Bind("lensPrice") %>' Visible="false"></asp:Label>

                            <asp:Label ID="Label1" runat="server" Text='<%#  string.Format(System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN"), "{0:#,## VNĐ}",Eval("lensPrice")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>   
                    <asp:TemplateField HeaderText="Tình trạng">
                        <EditItemTemplate>
                            <asp:Label ID="lensStatus" runat="server" Text='<%# Bind("lensStatus") %>'></asp:Label>

                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lensStatus1" runat="server" Text='<%# Bind("lensStatus") %>'></asp:Label>

                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Cập Nhật">
                        <EditItemTemplate>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:HyperLink runat="server" Text="Cập Nhật" NavigateUrl='<%# "/Admin/LensList_Detail.aspx?type=capnhat&id=" + Eval("lensId") %>'></asp:HyperLink>
                        </ItemTemplate>

                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" OnClientClick=" return confirm('Bạn có chắc chắn muốn xóa không ?');" Text="Xóa"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#0000A9" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#000065" />
            </asp:GridView>
</asp:Content>
